<template>
  <div class="sale-success">

    <div class="btn-box">
      <button class="success"><img src="../../assets/sale/success.png" alt=""></button>
    </div>
    <div class="sale-tip">您的宝贝信息已成功提交</div>
    <div class="btn-see">
      <a v-on:click="gotoAddress" class="see-order">查看寄卖</a>
    </div>
    <div style="margin-top: 10px;">
      <img :src="qr" alt="">
    </div>
  </div>
</template>

<script>


  export default {
    name: 'SaleSuccess',
    data () {
      return {
        popupVisible: false,
        qr:''
      }
    },
    mounted:function(){

      this.getQr();

    },
    components: {
    },
    methods: {
      showpopup(){
        this.popupVisible = true;
      },
      gotoAddress(){
        this.$router.push('/shop/details/'+this.$route.query.id);
      },
      getQr(){
        var ajaxData = {};
        ajaxData.token = sessionStorage.user && JSON.parse(sessionStorage.user).token;
        ajaxData.product_id = this.$route.query.id;
        var _this = this;

        $.ajax({
          type:'post',
          url: RouteMap.getqr,
          data:ajaxData,
          success:function(res){
            if(res.code == 200){
              _this.qr = res.data.qr;
            }
            else{
              //Toast(res.msg)
            }
          }
        })
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.sale-success{
  text-align: center;
  color: #707070;
}
  .btn-box{ margin-top: 3rem;}
  .sale-tip{
    margin:.8rem 0;
  }
  .success img{ width: 2rem;}
  .success{
    border:0;
    background-color:none;
  }



  .see-order{
    background: #b81d23;
    border-radius: 1rem;
    color: #fff;
    display: inline-block;
    padding: 0.3rem 1rem;
  }
</style>
